package com.web.main.entity.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @create 2020-11-22 16:37
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@ApiModel(value = "admin对象-val", description = "admin对象-des")
public class AdminLogin implements Serializable {

    private static final long serialVersionUID = 5933771199818648620L;

    @ApiModelProperty(value = "账号（手机号）", dataType = "String", required = true)
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "请输入有效的手机号码")
    @NotEmpty(message = "账号不能为空")
    private String username;

    @ApiModelProperty(value = "密码", dataType = "String", required = true)
    @NotEmpty(message = "密码不能为空")
    @Size(min = 6, max = 8, message = "密码在{min}~{max}之间")
    private String password;

}
